package com.usian.search.controller.v1;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.usian.common.dtos.ResponseResult;
import com.usian.model.search.dtos.UserSearchDto;
import com.usian.search.entity.ApAssociateWords;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.usian.search.service.IApAssociateWordsService;
import java.util.List;
import java.util.Map;

import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 联想词表 前端控制器
 * </p>
 *
 * @author usian
 * @since 2022-10-19
 */
@RestController
@RequestMapping("/api/v1/associate")
@Api(tags = "联想词表接口")
@CrossOrigin
public class ApAssociateWordsController{

    @Autowired
    private IApAssociateWordsService apAssociateWordsService;

    /**
     * 关键词联想
     * @param dto
     * @return
     */
    @PostMapping("/search")
    public ResponseResult<List<ApAssociateWords>> search(@Valid @RequestBody UserSearchDto dto){
        //List<ApAssociateWords> list = apAssociateWordsService.search(dto);
        List<ApAssociateWords> list = apAssociateWordsService.searchV2(dto);
        return ResponseResult.ok(list);
    }



}
